<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <img id="imgs" src="./img/img1.jpg" alt="">
    <script>
      function imgshow(delay=1000){
          return new Promise(resolve=>setInterval(resolve,delay));
      }
      imgshow(2000).then(value=>{
        let img=document.querySelector("#imgs");
         img.style.display="none";
         return imgshow(2000);
      }).then(value=>{
        let img=document.querySelector("#imgs");
                  img.style.display="block";
           
      })
     
    </script>
</body>
</html>